object Form1: TForm1
  Left = 192
  Top = 113
  Width = 930
  Height = 699
  Caption = #20998#27004#23618#25353#19987#26588#38144#21806#27719#24635
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object PageControl1: TPageControl
    Left = 0
    Top = 65
    Width = 922
    Height = 601
    ActivePage = TabSheet2
    Align = alClient
    TabOrder = 0
    object TabSheet1: TTabSheet
      Caption = #20998#27004#23618#25353#19987#26588#38144#21806#27719#24635
      object Panel2: TPanel
        Left = 0
        Top = 113
        Width = 914
        Height = 415
        Align = alClient
        TabOrder = 0
        object DBGridEh1: TDBGridEh
          Left = 1
          Top = 1
          Width = 912
          Height = 413
          Align = alClient
          DataSource = DataSource1
          ShowSerialNo = False
          Flat = False
          FooterColor = clWindow
          FooterFont.Charset = DEFAULT_CHARSET
          FooterFont.Color = clWindowText
          FooterFont.Height = -11
          FooterFont.Name = 'Tahoma'
          FooterFont.Style = []
          TabOrder = 0
          TitleFont.Charset = DEFAULT_CHARSET
          TitleFont.Color = clWindowText
          TitleFont.Height = -11
          TitleFont.Name = 'Tahoma'
          TitleFont.Style = []
          Columns = <
            item
              EditButtons = <>
              FieldName = 'SCDMFID'
              Footers = <>
              Title.Caption = #23703#32452#21495
              Width = 89
            end
            item
              EditButtons = <>
              FieldName = 'MFCNAME'
              Footers = <>
              Title.Caption = #23703#32452#21517#31216
              Width = 218
            end
            item
              EditButtons = <>
              FieldName = 'THISXSSR'
              Footers = <>
              Title.Caption = #38144#21806#21512#35745
              Width = 118
            end
            item
              EditButtons = <>
              FieldName = 'SCDDATE'
              Footers = <>
              Title.Caption = #26085#26399
              Width = 96
            end>
        end
      end
      object Panel3: TPanel
        Left = 0
        Top = 528
        Width = 914
        Height = 45
        Align = alBottom
        TabOrder = 1
        object Button1: TButton
          Left = 371
          Top = 10
          Width = 75
          Height = 25
          Caption = #26597#35810
          TabOrder = 0
          OnClick = Button1Click
        end
        object Button2: TButton
          Left = 469
          Top = 10
          Width = 75
          Height = 25
          Caption = #23548#20986
          TabOrder = 1
          OnClick = Button2Click
        end
      end
      object GroupBox1: TGroupBox
        Left = 0
        Top = 0
        Width = 914
        Height = 113
        Align = alTop
        Caption = #26465#20214
        Font.Charset = ANSI_CHARSET
        Font.Color = clWindowText
        Font.Height = -19
        Font.Name = 'Consolas'
        Font.Style = [fsBold]
        ParentFont = False
        TabOrder = 2
        object Label1: TLabel
          Left = 117
          Top = 27
          Width = 68
          Height = 19
          Caption = #23703#32452#21495#65306
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clWindowText
          Font.Height = -16
          Font.Name = 'Tahoma'
          Font.Style = [fsBold]
          ParentFont = False
        end
        object RadioButton1: TRadioButton
          Left = 16
          Top = 56
          Width = 97
          Height = 17
          Caption = #26085#21512#35745
          TabOrder = 0
        end
        object RadioButton2: TRadioButton
          Left = 16
          Top = 80
          Width = 89
          Height = 17
          Caption = #26376#21512#35745
          TabOrder = 1
        end
        object ComboBox2: TComboBox
          Left = 16
          Top = 24
          Width = 81
          Height = 27
          Style = csDropDownList
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clWindowText
          Font.Height = -16
          Font.Name = 'Tahoma'
          Font.Style = [fsBold]
          ItemHeight = 19
          ItemIndex = 0
          ParentFont = False
          TabOrder = 2
          Text = #19987#26588
          OnSelect = ComboBox2Select
          Items.Strings = (
            #19987#26588
            #27004#23618)
        end
        object Edit1: TEdit
          Left = 181
          Top = 21
          Width = 193
          Height = 30
          TabOrder = 3
        end
      end
    end
    object TabSheet2: TTabSheet
      Caption = #25353#21830#21697#20998#31867#26376#32479#35745
      ImageIndex = 1
      object Panel5: TPanel
        Left = 0
        Top = 0
        Width = 914
        Height = 528
        Align = alClient
        TabOrder = 0
        object DBGridEh2: TDBGridEh
          Left = 1
          Top = 1
          Width = 912
          Height = 526
          Align = alClient
          DataSource = DataSource2
          ShowSerialNo = False
          Flat = False
          Font.Charset = ANSI_CHARSET
          Font.Color = clWindowText
          Font.Height = -15
          Font.Name = 'Consolas'
          Font.Style = []
          FooterColor = clWindow
          FooterFont.Charset = DEFAULT_CHARSET
          FooterFont.Color = clWindowText
          FooterFont.Height = -11
          FooterFont.Name = 'Tahoma'
          FooterFont.Style = []
          Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgTabs, dgRowSelect, dgConfirmDelete, dgCancelOnExit]
          ParentFont = False
          TabOrder = 0
          TitleFont.Charset = DEFAULT_CHARSET
          TitleFont.Color = clWindowText
          TitleFont.Height = -11
          TitleFont.Name = 'Tahoma'
          TitleFont.Style = []
        end
      end
      object Panel6: TPanel
        Left = 0
        Top = 528
        Width = 914
        Height = 45
        Align = alBottom
        TabOrder = 1
        object Button3: TButton
          Left = 371
          Top = 10
          Width = 75
          Height = 25
          Caption = #26597#35810
          TabOrder = 0
          OnClick = Button3Click
        end
        object Button4: TButton
          Left = 469
          Top = 10
          Width = 75
          Height = 25
          Caption = #23548#20986
          TabOrder = 1
          OnClick = Button4Click
        end
      end
    end
  end
  object GroupBox3: TGroupBox
    Left = 0
    Top = 0
    Width = 922
    Height = 65
    Align = alTop
    Caption = #26597#35810#26465#20214
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Consolas'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 1
    object Label7: TLabel
      Left = 8
      Top = 31
      Width = 51
      Height = 19
      Caption = #26085#26399#65306
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -16
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ParentFont = False
    end
    object Label8: TLabel
      Left = 376
      Top = 31
      Width = 51
      Height = 19
      Caption = #27004#23618#65306
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -16
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ParentFont = False
    end
    object Shape1: TShape
      Left = 190
      Top = 41
      Width = 36
      Height = 3
      Brush.Color = clBlack
    end
    object DateTimePicker2: TDateTimePicker
      Left = 232
      Top = 27
      Width = 129
      Height = 30
      Date = 40061.751591608790000000
      Time = 40061.751591608790000000
      Font.Charset = ANSI_CHARSET
      Font.Color = clWindowText
      Font.Height = -19
      Font.Name = 'Consolas'
      Font.Style = [fsBold]
      ParentFont = False
      TabOrder = 0
    end
    object DateTimePicker1: TDateTimePicker
      Left = 56
      Top = 27
      Width = 129
      Height = 30
      Date = 40061.751573159720000000
      Time = 40061.751573159720000000
      Font.Charset = ANSI_CHARSET
      Font.Color = clWindowText
      Font.Height = -19
      Font.Name = 'Consolas'
      Font.Style = [fsBold]
      ParentFont = False
      TabOrder = 1
    end
    object ComboBox1: TComboBox
      Left = 424
      Top = 25
      Width = 145
      Height = 30
      Style = csDropDownList
      Font.Charset = ANSI_CHARSET
      Font.Color = clWindowText
      Font.Height = -19
      Font.Name = 'Consolas'
      Font.Style = [fsBold]
      ItemHeight = 22
      ParentFont = False
      TabOrder = 2
      OnSelect = ComboBox1Select
      Items.Strings = (
        ''
        #19968#27004#21830#22330
        #20108#27004#21830#22330
        #19977#27004#21830#22330
        #22235#27004#21830#22330
        #20116#27004#21830#22330)
    end
  end
  object OraSession1: TOraSession
    Username = 'dbusrmkt205'
    Password = 'futuremkt'
    Server = 'M205_DB'
    Connected = True
    Left = 152
    Top = 361
  end
  object OraQuery1: TOraQuery
    SQL.Strings = (
      'select mfcname,sum(thisxssr),monthaa from('
      
        '         SELECT SCDMKT, SCDMFID,to_char(SCDDATE,'#39'YYYYMM'#39') montha' +
        'a, SUM(NVL(XSSR + PFSR, 0)) THISXSSR,b.mfcname'
      '          FROM DBUSRMKT205.SALECOSTDAY a,DBUSRPUB.MANAFRAME b'
      
        '        WHERE a.scdmfid=b.mfcode and b.mffcode='#39'205'#39' and mfpcode' +
        '='#39'20502'#39' and scddate>= '
      ''
      
        'TO_DATE('#39'2008-01'#39', '#39'YYYY-MM'#39') and scddate<= TO_DATE('#39'2008-12'#39', '#39 +
        'YYYY-MM'#39') '
      ''
      'and a.scdmfid=b.mfcode'
      
        '        -- WHERE SALECOSTDAY.SCDDATE = TO_DATE('#39'2009-01-31'#39', '#39'YY' +
        'YY-MM-DD'#39')'
      '         GROUP BY SCDMKT, SCDMFID,SCDDATE,b.mfcname'
      '         ) group by monthaa,mfcname')
    Left = 120
    Top = 361
  end
  object DataSource1: TDataSource
    DataSet = OraQuery1
    Left = 96
    Top = 368
  end
  object SaveDialog1: TSaveDialog
    DefaultExt = 'xls'
    Filter = '*.xls|*.xls'
    Left = 184
    Top = 361
  end
  object OraSession2: TOraSession
    Username = 'dbusrmkt205'
    Password = 'futuremkt'
    Server = 'M205_DB'
    Connected = True
    LoginPrompt = False
    Left = 312
    Top = 136
  end
  object OraQuery2: TOraQuery
    Session = OraSession2
    SQL.Strings = (
      '/* Formatted on 2010/01/02 11:03 (Formatter Plus v4.8.8) */'
      'SELECT   tm5.catcname name1, tm4.*'
      '    FROM (SELECT tm3.catcname name2, tm2.*'
      '            FROM (SELECT tm1.catcname, tm.*'
      
        '                    FROM (SELECT   a.sabm, a.sadl, a.sazl, a.sac' +
        'atcode,'
      '                                   SUM (CASE'
      
        '                                           WHEN sadate = TO_DATE' +
        ' ('#39'2009-12-1'#39', '#39'yyyy-mm-dd'#39')'
      '                                              THEN thistoday'
      '                                           ELSE 0'
      '                                        END'
      '                                       ) AS "20091201",'
      '                                   SUM (CASE'
      
        '                                           WHEN sadate = TO_DATE' +
        ' ('#39'2009-12-2'#39', '#39'yyyy-mm-dd'#39')'
      '                                              THEN thistoday'
      '                                           ELSE 0'
      '                                        END'
      '                                       ) AS "20091202",'
      '                                   SUM (CASE'
      
        '                                           WHEN sadate = TO_DATE' +
        ' ('#39'2009-12-3'#39', '#39'yyyy-mm-dd'#39')'
      '                                              THEN thistoday'
      '                                           ELSE 0'
      '                                        END'
      '                                       ) AS "20091203"'
      '                              FROM (SELECT *'
      '                                      FROM salecostday_a315'
      '                                     WHERE sabm = '#39'20501'#39
      
        '                                       AND sadate >= TO_DATE ('#39'2' +
        '009-12-01'#39', '#39'yyyy-mm-dd'#39')'
      
        '                                       AND sadate <= TO_DATE ('#39'2' +
        '009-12-03'#39', '#39'yyyy-mm-dd'#39')'
      '                                       AND ((   thistoday <> 0'
      '                                             OR lasttoday <> 0'
      '                                             OR thisxssr <> 0'
      '                                             OR lastxssr <> 0'
      '                                             OR thismonxssr <> 0'
      '                                             OR lastmonxssr <> 0'
      
        '                                             OR lastyearxssr <> ' +
        '0'
      '                                            )'
      '                                           )) a'
      '                             WHERE a.sabm = '#39'20501'#39
      
        '                          GROUP BY a.sabm, a.sadl, a.sazl, a.sac' +
        'atcode) tm,'
      '                         goodscat tm1'
      '                   WHERE tm.sacatcode = tm1.catcode) tm2,'
      '                 goodscat tm3'
      '           WHERE tm2.sazl = tm3.catcode) tm4,'
      '         goodscat tm5'
      '   WHERE tm4.sadl = tm5.catcode'
      'ORDER BY tm4.sadl, tm4.sazl, tm4.sacatcode')
    Left = 360
    Top = 128
  end
  object DataSource2: TDataSource
    AutoEdit = False
    DataSet = OraQuery2
    Left = 408
    Top = 120
  end
end
